import Vue from "vue";
import VueRouter from "vue-router";
import Video from "@/views/VideoView.vue";
import Login from "@/views/LoginView.vue";
import Register from "@/views/RegisterView.vue";
import Menu from "@/views/MenuView.vue";
import Home from "@/views/HomeView.vue"
import Creator from "@/views/CreatorView.vue";
Vue.use(VueRouter)

const routes = [
    {
        path:"/login",
        component:Login
    },
    {
        path: "/video/:id",  // 添加动态参数
        component: Video,
        meta: { requiresAuth: false }
    },
    {
        path: "/menu",
        component: Menu,
        meta: { requiresAuth: true }
    },
    {
        path: "/register",
        component: Register
    },
    {
        path: "/",
        component: Home
    },
    {
        path: "/creator",
        component: Creator,
        meta: { requiresAuth: true }
    },
]
const router = new VueRouter({
    routes: routes
});
export default router
